﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MusicAcademy
{
    public partial class frmLogin : Form
    {
        public frmLogin()
        {
            InitializeComponent();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (UserManager.Login(txtUserName.Text, txtPassword.Text) == true)
            {
                frmMain m = new frmMain();
                m.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("نام کاربری و یا رمز عبور اشتباه است !", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }

        private void frmLogin_Load(object sender, EventArgs e)
        {
            Program.FilesPath = Application.StartupPath + "\\Files\\";
        }
    }
}
